<template>

	<view class="main">

		<u-navbar :bgColor="bgColor" :fixed="false" title="随访记录" placeholder="true" :autoBack="true"></u-navbar>

		<z-paging ref="paging" v-model="dataList" @query="queryList" usePageScroll>
		<view class=" column_c">
			<view class="card-content" v-for="(item, index) in dataList" :key="index">
				<view class="row_a_c space-between">
					<view class="row_a_c">
						<view class="shuxian"></view>
						<view class="clinic">{{item.user.name}}</view>
					</view>
					<text class="status success center">{{item.name}}</text>
				</view>
				<view class="xuxian"></view>
				<view class="appointment-info">
					<view class="name">随访时间：{{item.created_at}}</view>
					<view class="time">随访人员：{{item.staff.name}}</view>
					<view class="time">随访内容：{{item.content}}</view>
				</view>
			</view>
		</view>
		</z-paging>



	</view>

</template>

<script>
	import api_follow from '@/api/follow.js';
	import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin';

	export default {
		mixins: [ZPMixin],
		async onLoad(option) {
			this.user = option.id;
		},

		async onShow() {
			this.access_token = uni.getStorageSync('access_token');
			if (!this.access_token) {
				uni.navigateTo({
					url: '/pages/auth/login'
				});
			} else {
				// this.getPlanUserListFuc(); // 患者随访记录
			}
		},
		data() {
			return {
				access_token: null,
				bgColor: 'rgba(0, 31, 63, 0)',
				dataList: []

			};
		},
		methods: {
			
			
			
			
			async queryList(pageNo, pageSize) {
			
				var per = {
					no_page: pageNo,
					page_size: pageSize,
					user: this.user,
				}
				
				const res = await api_follow.getPlanUserList(per);
				if (res.code == 1) {
					this.$refs.paging.complete(res.data.list);
				} else {
					this.$refs.paging.complete(false);
				}
			
			},
			
			
			
			// 患者随访记录
			// async getPlanUserListFuc() {
			// 	var per = {
			// 		user: this.user,
			// 		no_page: 1,
			// 		page_size: 10
			// 	}
			// 	const res = await api_follow.getPlanUserList(per);
			// 	if (res.code == 1) {
			// 		this.dataList = res.data.list
			// 	} else {
			// 		this.$util.msg(res.message);
			// 		return;
			// 	}
			// },
			
			
			toUrl(url) {
				this.navTo(url);
			},

		}
	};
</script>

<style scoped lang="scss">
	.main {
		background: #FAFAFA;
		height: 100vh;
	}



	.time {
		font-weight: 400;
		font-size: 28rpx;
		color: #7F7F7F;
	}




	.shuxian {
		margin-right: 16rpx;
		width: 8rpx;
		height: 32rpx;
		background: linear-gradient(180deg, #EBF6F6 0%, #27CCBB 100%);
		border-radius: 8rpx 8rpx 8rpx 8rpx;
	}

	.status {
		width: 128rpx;
		height: 40rpx;
		background: #1FA194;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #FFFFFF;
	}




	.card-content {
		width: 686rpx;
		min-height: 250rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 8rpx -2rpx rgba(0, 0, 0, 0.04), 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.03), 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.02);
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		padding: 32rpx;
		margin-bottom: 20rpx;
	}

	.clinic {
		font-weight: bold;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);


	}

	.name {

		font-weight: 400;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 0.6);
		margin-bottom: 16rpx;

	}

	.time {
		font-weight: 400;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 0.6);
		margin-bottom: 16rpx;
	}

	.xuxian {
		width: 100%;
		/* 设置宽度 */
		border-top: 2px dashed #E7E7E7;
		/* 设置虚线样式 */
		margin: 20px 0;
	}

	.appointment-info {
		margin-top: 20rpx;
	}
</style>